package com.jwthhealth_pub.find;

import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.GridView;
import android.widget.TextView;

import com.jwthhealth_pub.R;
import com.jwthhealth_pub.common.base.BasetFragment;
import com.jwthhealth_pub.find.adapter.FindCardGrideViewAdapter;
import com.jwthhealth_pub.home.presenter.HealthPresenter;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;


/**
 * FindFragment
 * Created by yang on 2017/12/13.
 */

public class FindFragment extends BasetFragment implements HealthPresenter.View{
        private View view;
        private Unbinder unbinder;
        @BindView(R.id.tv_type)
        TextView tv_type;
        @BindView(R.id.ll_card_list)
        View ll_card_list;
        @BindView(R.id.gridView)
        GridView gridView;

@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {

         view = View.inflate(getActivity(), R.layout.fragment_find, null);
         unbinder = ButterKnife.bind(this, view);
         initView();
         return view;
         }

        private void initView() {
        }

        @OnClick(R.id.tv_type)
        public void onClickType() {// 点击运动建议
            ll_card_list.setVisibility(View.GONE);
            gridView.setVisibility(View.VISIBLE);
            List<String> names = new ArrayList<String>();
            for(int i=1;i<=31;i++){
                names.add(i+"");
            }
            FindCardGrideViewAdapter adapter = new FindCardGrideViewAdapter(getActivity(), names);
            gridView.setAdapter(adapter);

        }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        unbinder.unbind();
    }

    @Override
    protected void title() {

    }
}